/**
 * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.babble.user.vo;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;

import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Null;
import javax.validation.constraints.Pattern;


/**
 * 用户表实体类
 *
 * @author Blade
 * @since 2021-11-07
 */
@Data
public class UserUpdVO implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 性别(0:未知,1:男2:女)
	 */

	@Range(min = 0, max = 3,message = "性别(0:未知,1:男2:女)")
	@ApiModelProperty(value = "性别(0:未知,1:男2:女)")
	private Integer gender;
	/**
	 * 个人头像
	 */
	@URL(message = "不是正确的url")
	private String avatar;
	/**
	 * 邮箱
	 */
	@Email(message = "邮箱格式错误")
	private String email;
	/**
	 * 昵称
	 */
	@Length(min = 4,max = 14,message = "昵称4-14")
	private String nickName;
	/**
	 * 出生年月日
	 */
	@DateTimeFormat(pattern = "yyy-MM-dd")
	private LocalDate birthday;
	/**
	 * 手机
	 */
	@Pattern(regexp="^1[3-9]\\d{9}$",message = "手机格式错误")
	private String mobile;
	/**
	 * 自我简介最多150字
	 */

	@Length(min = 0,max = 150,message = "自我简介最多150字")
	private String summary;
	/**
	 * 职业
	 */

	@Pattern(regexp="^(工人|务农|警察|自由职业者)$",message="职业:工人`务农`警察`自由职业者")
	@ApiModelProperty(value = "职业")
	private String occupation;
	/**
	 * 资料来源：平台注册、gitee
	 */

	@Pattern(regexp="^(平台注册|gitee)$",message="资料来源:平台注册`gitee")
	@ApiModelProperty(value = "资料来源：平台注册、gitee")
	private String source;

	/**
	 * QQ号
	 */
	@Pattern(regexp="^([1-9][0-9]{4,10})$",message="传入正确QQ号")
	private String qq;
	/**
	 * 微信号
	 */
	@Pattern(regexp="^[a-zA-Z]{1}[-_a-zA-Z0-9]{5,19}$",message="传入正确微信号")
	private String wechat;


}
